package com.changgou.search.controller;

import com.changgou.search.service.SkuService;
import entity.Result;
import entity.StatusCode;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 描述
 *
 * @author ljh
 * @version 1.0
 * @package com.changgou.search.controller *
 * @Date 2019-11-28
 * @since 1.0
 */
@RequestMapping("/search")
@RestController
public class SkuController {

    @Autowired
    private SkuService searchService;

    @RequestMapping("/importES")
    public Result importES(){

        searchService.importES();

        return new Result(true, StatusCode.OK,"导入成功");
    }

    @GetMapping
    public Map search(@RequestParam(required = false) Map searchMap){
        return searchService.search(searchMap);
    }
}
